﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EyFramework.Sys.Core.Dao;
using EyFramework.Sys.Entity;
using EyFramework.Sys.Entity.Dto;
using SqlSugar;

namespace EyFramework.Sys.Core.Service
{
    /// <summary>
    ///  QRTZ_CS_TASK表的服务实现类
    /// </summary>
    public class QrtzCsTaskService : BaseHisService, IQrtzCsTaskService
    {
        protected readonly IQrtzCsTaskDao _QrtzCsTaskDao;

        public QrtzCsTaskService(IQrtzCsTaskDao qrtzCsTaskDao)
        {
            _QrtzCsTaskDao = qrtzCsTaskDao;
        }

        public bool AddNewTask(QrtzCsTask task)
        {
            return _QrtzCsTaskDao.Insert(task);
        }

        public List<QrtzCsTask> GetAllTask(TaskQueryParam taskQueryParam)
        {
            return _QrtzCsTaskDao.GetAllTask(taskQueryParam);
        }

        public QrtzCsTask GetTaskById(string taskId)
        {
            return _QrtzCsTaskDao.GetById(long.Parse(taskId));
        }

        public bool UpdateTask(QrtzCsTask task)
        {
            return _QrtzCsTaskDao.Update(task);
        }
    }
}